#-------------------------------------------------#
# Project created by QtCreator 2024-07-28T15:59:42
# 重构目录结构 - 2025-10-14
#-------------------------------------------------

QT       += core gui widgets

TEMPLATE = app
TARGET = QTNETSniffer
INCLUDEPATH += . include

# 确保Qt头文件路径正确包含
INCLUDEPATH += $${QT.core.includes} $${QT.gui.includes} $${QT.widgets.includes}

# 设置构建目录
DESTDIR = ./build
OBJECTS_DIR = ./build/.obj
MOC_DIR = ./build/.moc
UI_DIR = ./build/.ui
RCC_DIR = ./build/.rcc

# 添加pcap库链接，根据不同平台自动选择适当的设置

# Windows平台配置
win32 {
    # 假设WinPcap或Npcap已安装在默认位置
    INCLUDEPATH += C:/WpdPack/include
    LIBS += -LC:/WpdPack/lib -lwpcap
}

# Linux平台配置
unix:!macx {
    # Linux通常不需要额外的INCLUDEPATH设置
    LIBS += -lpcap
}

# macOS平台配置
macx {
    # 处理Homebrew和MacPorts可能的安装位置
    INCLUDEPATH += /usr/local/include /opt/local/include
    LIBS += -L/usr/local/lib -L/opt/local/lib -lpcap
}

# 头文件
HEADERS += \
    include/adapterselector.h \
    include/common.h \
    include/packetcapturer.h \
    include/widget.h \
    include/session.h \
    include/sessionmanager.h \
    include/sessiondialog.h \
    include/packetdetaildialog.h

# 源文件
SOURCES += \
    src/adapterselector.cpp \
    src/main.cpp \
    src/packetcapturer.cpp \
    src/widget.cpp \
    src/session.cpp \
    src/sessionmanager.cpp \
    src/sessiondialog.cpp \
    src/packetdetaildialog.cpp

# UI文件
FORMS += \
    ui/adapterselector.ui \
    ui/widget.ui \
    ui/packetdetaildialog.ui
